package com.xunk.scene.api;

import com.xunk.common.core.constant.ServiceNameConstants;
import com.xunk.common.core.web.domain.AjaxResult;
import com.xunk.scene.api.factory.RemoteSceneFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ProjectName: HIM
 * @Package: com.xunk.scene.api
 * @ClassName: RemoteSceneService
 * @Author: luanzhiwei
 * @Description: 场景接口调用feign客户端
 * @Date: 2021/5/14 10:22
 * @Version: 1.0
 */
@FeignClient(contextId = "remoteSceneService", value = ServiceNameConstants.SCENE_SERVICE, fallbackFactory = RemoteSceneFallbackFactory.class)
public interface RemoteSceneService {
    /**
     * 设备信息通知场景服务
     *
     * @param deviceSn
     * @param type
     * @param value
     */
    @GetMapping(value = "/scene/notify")
    void sceneNotify(@RequestParam("deviceSn") String deviceSn, @RequestParam("type") String type, @RequestParam("value") String value);

    /**
     * 定时执行场景
     * @param sceneId
     * @return
     */
    @GetMapping(value = "/scene/timer/exec")
    AjaxResult execCron(@RequestParam("sceneId") String sceneId);
}
